import { useUserInfoStore } from "@/stores/userInfo";
import type { App } from "vue";

export default function registerDirective(app: App) {
  app.directive("permission", (el, binding) => {
    const userInfoStore = useUserInfoStore();
    if (userInfoStore.buttons.includes(binding.value)) return;
    el.remove();
  });
}
